<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>${message("admin.admin.edit")} - Powered By WISERVICE</title>
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.tools.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/jquery.validate.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/input.js"></script>
<style type="text/css">
.roles label {
	width: 150px;
	display: block;
	float: left;
	padding-right: 5px;
}
</style>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	
	[@flash_message /]
	
	// 表单验证
	$inputForm.validate({
		rules: {
            'sysUser.password': {
				pattern: /^[^\s&\"<>]+$/,
				minlength: 4,
				maxlength: 20
			},
			rePassword: {
				equalTo: "#password"
			},
            'sysUser.email': {

				email: true
			}
//			,roleIds: "required"
		},
		messages: {
            'sysUser.password': {
				pattern: "${message("admin.validate.illegal")}"
			}
		}
	});

});
</script>
</head>
<body>
	<div class="path">
		<a href="${base}/admin/common/index">${message("admin.path.index")}</a> &raquo; 账号设置
	</div>
	<form id="inputForm" action="update" method="post">
		<input type="hidden" name="sysUser.id" value="${admin.id}" />

		<table class="input tabContent">
			<tr>
				<th>
					${message("Admin.username")}:
				</th>
				<td>
					${admin.login_name}
				</td>
			</tr>
            <tr>
                <th>
				${message("Admin.name")}:
                </th>
                <td>
                    <input type="text" name="sysUser.name" class="text" value="${admin.name}" maxlength="200" />
                </td>
            </tr>
			<tr>
				<th>
					${message("Admin.password")}:
				</th>
				<td>
					<input type="password" id="password" name="sysUser.password" class="text" maxlength="20" />
                    <span class="tips">不填写密码,不会修改密码!</span>
				</td>

			</tr>
			<tr>
				<th>
					${message("admin.admin.rePassword")}:
				</th>
				<td>
					<input type="password" name="rePassword" class="text" maxlength="20" />
				</td>
			</tr>
			<tr>
				<th>
					${message("Admin.email")}:
				</th>
				<td>
					<input type="text" name="sysUser.email" class="text" value="${admin.email}" maxlength="200" />
				</td>
			</tr>
			[#--<tr class="roles">--]
				[#--<th>--]
					[#--<span class="requiredField">*</span>${message("Admin.roles")}:--]
				[#--</th>--]
				[#--<td>--]
					[#--<span class="fieldSet">--]
						[#--[#list roles as role]--]
							[#--<label>--]
								[#--<input type="checkbox" name="roleIds" value="${role.id}"[#if admin.roles?seq_contains(role.id)] checked="checked"[/#if] />${role.name}--]
							[#--</label>--]
						[#--[/#list]--]
					[#--</span>--]
				[#--</td>--]
			[#--</tr>--]
		</table>
		<table class="input">
			<tr>
				<th>
					&nbsp;
				</th>
				<td>
					<input type="submit" class="button" value="${message("admin.common.submit")}" />
					<input type="button" id="backButton" class="button" value="${message("admin.common.back")}" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>